//
//  LBViewController.m
//  LBUserGuideTip
//
//  Created by LINAICAI on 10/31/2017.
//  Copyright (c) 2017 LINAICAI. All rights reserved.
//

#import "LBViewController.h"
#import <LBUserGuideView.h>
#import <UIButton+LBStyle.h>
@interface LBViewController ()
{
    UIButton *_button;
    UITextField *_textField;
}
@end

@implementation LBViewController
- (void)buttonClick:(UIButton *)button{
    UIImage *image1 = [UIImage imageNamed:@"1.png"];
    UIImage *image2 = [UIImage imageNamed:@"2.png"];
    [[[LBUserGuideView alloc]initWithImage:image1 imagePositon:LBUserGuideImageInBottom maskView:_button maskViewMargin:10 maskViewCorner:25 afterTap:^{
        NSLog(@"点击了第一个，准备要隐藏");
        
        [[[LBUserGuideView alloc]initWithImage:image2 imagePositon:LBUserGuideImageInTop maskView:_button maskViewMargin:5 maskViewCorner:8 afterTap:^{
            NSLog(@"点击了第二个，准备要隐藏");
        }]showInView:[UIApplication sharedApplication].keyWindow];
        
    }]showInView:[UIApplication sharedApplication].keyWindow];
    

}
-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    UIImage *image1 = [UIImage imageNamed:@"1.png"];
    UIImage *image2 = [UIImage imageNamed:@"2.png"];
    [[[LBUserGuideView alloc]initWithImage:image1 imagePositon:LBUserGuideImageInBottom maskView:_button maskViewMargin:10 maskViewCorner:25 afterTap:^{
        NSLog(@"点击了第一个，准备要隐藏");
        
        [[[LBUserGuideView alloc]initWithImage:image2 imagePositon:LBUserGuideImageInTop maskView:_button maskViewMargin:5 maskViewCorner:8 afterTap:^{
            NSLog(@"点击了第二个，准备要隐藏");
        }]showInView:[UIApplication sharedApplication].keyWindow];
        
    }]showInView:[UIApplication sharedApplication].keyWindow];
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setBackgroundColor:[UIColor whiteColor]];
    [button setGradientBlueBackgroundImage];
    [button setTitle:@"发表文章" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    button.frame = CGRectMake(self.view.bounds.size.width/2-300/2, 400, 300, 50);
    [self.view addSubview:button];
    _button = button;
    
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button1 setBackgroundColor:[UIColor blueColor]];
    [button1 setTitle:@"底部其他视图" forState:UIControlStateNormal];
    [button1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    button1.frame = CGRectMake(20, 50, 100, 30);
    [self.view addSubview:button1];
    
    
    [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    
    

	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
